<template>
    <Popup ref="popupRef" title="新增配置组" :formState="formState" :rules="rules" :add-api="addSystemConfigGroup" @success="emit('success')">
        <a-form-item label="配置组名称" name="title">
            <a-input v-model:value="formState.title" placeholder="请输入配置组名称" />
        </a-form-item>
    </Popup>

</template>

<script setup lang="ts">
import { addSystemConfigGroup } from '@/api/system/system'
import Popup from '@/components/popup/index.vue'
const popupRef = ref<InstanceType<typeof Popup>>()

const emit = defineEmits(['success'])
const formState = reactive({
    title: ''
})
const rules = reactive({
    title: [{ required: true, message: '请输入配置组名称' }]
})

const open = () => {
    popupRef.value?.open('add' , formState)
}

defineExpose({
    open
})
</script>


